{
    "cells": [
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "import json\n",
                "import os\n",
                "import orchest\n",
                "import orchest.parameters as op"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "result = {}\n",
                "result[\"env\"] = dict(os.environ)"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "pstep, ppipe = op.get_params()\n",
                "result[\"step_parameters\"] = pstep\n",
                "result[\"pipeline_parameters\"] = ppipe"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "# Use a default file if it's not provided.\n",
                "out_file_path = pstep.get(\"test-output-file\", \"test-output.json\")"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "with open(f\"/data/{out_file_path}\", \"w\") as out_file:\n",
                "    json.dump(result, out_file)"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": []
        }
    ],
    "metadata": {
        "kernelspec": {
            "display_name": "Python 3",
            "language": "python",
            "name": "orchest-kernel-4b3659e0-db0a-4ff0-9b60-fb53903dd218"
        },
        "language_info": {
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "file_extension": ".py",
            "mimetype": "text/x-python",
            "name": "python",
            "nbconvert_exporter": "python",
            "pygments_lexer": "ipython3",
            "version": "3.7.6"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 4
}